/**
 * http://usejsdoc.org/
 */
var encodeModule = require('./encode_module');

/**encode with hash*/
console.log('-------------encode with hash--------------');
var hashEncodeStr = encodeModule.encode('hash','md5','devintam','hex');
console.log(hashEncodeStr);

/**encode with hmac*/
console.log('-------------encode with hmac--------------');
var hmacEncodeStr = encodeModule.encode('hmac','md5','devintam','hex','dan');
console.log(hmacEncodeStr);


/**encode with sign*/
console.log('-------------encode with sign--------------');
var fs = require('fs');
var privatePem = fs.readFileSync('client.pem');
var key = privatePem.toString();
var signEncodeStr = encodeModule.encode('sign','RSA-SHA256','devintam','hex',key,'utf8');
console.log(signEncodeStr);


/**encode with cipher*/
console.log('-------------encode with cipher--------------');
var cipherEncodeStr = encodeModule.encode('cipher','aes-256-cbc','devintam','hex','salt_from','utf8');
console.log(cipherEncodeStr);


/**encode with decipher*/
console.log('-------------encode with decipher--------------');
var decipherEncodeStr = encodeModule.decode('cipher','aes-256-cbc',cipherEncodeStr,'hex','salt_from','utf8');
console.log(decipherEncodeStr);